package com.yhsimon.visitor;

/**
 * @author： YHSimon
 * @date： 2021-10-11 10:52
 */
public class Client {
    public static void main(String[] args) {
        //创建ObjectStructure
        ObjectStructure objectStructure = new ObjectStructure();

        objectStructure.attach(new Man("李四"));
        objectStructure.attach(new Woman("张三"));

        Success success = new Success();
        //objectStructure里的元素全部赋予失败  ？
        objectStructure.display(success);

        System.out.println("-----------------");
        Fail fail = new Fail();
        objectStructure.attach(new Man("王五"));
        objectStructure.attach(new Man("赵六"));
        objectStructure.display(fail);

        System.out.println("--------待定---------");
        Wait wait = new Wait();
        objectStructure.attach(new Woman("洪七"));
        objectStructure.display(wait);
    }
}
